﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Bson.Serialization.Attributes;

namespace BlueLotus7.CDKey
{
    public class CDKeyObject
    {
        #region Properties

        [BsonId]
        public Guid Key
        {
            get;
            set;
        }

        public string ApplicationName
        {
            get;
            set;
        }

        public string Version
        {
            get;
            set;
        }

        public string KeyContent
        {
            get;
            set;
        }

        public string Comments
        {
            get;
            set;
        }

        public bool IsVerified
        {
            get;
            set;
        }

        public bool IsOfficial
        {
            get;
            set;
        }

        #endregion

        public CDKeyObject(Guid key)
        {
            this.Key = key;
            this.ApplicationName = this.Version = this.KeyContent = this.Comments = string.Empty;
        }

        public CDKeyObject()
            : this(Guid.NewGuid())
        {
        }

        public override string ToString()
        {
            return this.ApplicationName + "," + this.Version;
        }
    }
}
